package com.huluobo.a2206douyindemo.adapter;

import android.graphics.Color;
import android.util.Log;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.a2206douyindemo.R;
import com.huluobo.a2206douyindemo.live.MessageEntity;

/**
 * Created by LC on 2024/8/30.
 */
public class ResponseAdapter extends BaseQuickAdapter<MessageEntity, BaseViewHolder> {
    public ResponseAdapter() {
        super(R.layout.item_char_room);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, MessageEntity message) {
        Log.i("TagA", "message:" + message.toString());
        String username = message.getUsername();
        String content = message.getContent();
        String msg = username + ":" + content;
        ((TextView) baseViewHolder.getView(R.id.item_chat_room_tv)).setTextColor(Color.BLACK);
        baseViewHolder.setText(R.id.item_chat_room_tv, msg);
    }
}
